package com.tiance.demo.service.mysql.bo;

import com.tiance.demo.service.mysql.utils.ByteUtils;

/**
 * 文件尾, 一个页的最后几个字节
 */
public class FileTailer {

    //一个页尾是8字节
    public static final int SIZE = 8;

    public static final int OFFSET_START = 16 * 1024 - 8;

    private byte[] bytes;

    private String spaceOrChksum;

    //TODO
    private String last4;

    public byte[] getBytes() {
        return bytes;
    }

    public void setBytes(byte[] bytes) {
        this.bytes = bytes;
    }

    public String getSpaceOrChksum() {
        return spaceOrChksum;
    }

    public void setSpaceOrChksum(String spaceOrChksum) {
        this.spaceOrChksum = spaceOrChksum;
    }

    public String getLast4() {
        return last4;
    }

    public void setLast4(String last4) {
        this.last4 = last4;
    }

    @Override
    public String toString() {
        return "FileTailer:\n" +
                "bytes=" + ByteUtils.bytes2HexStr(bytes) +
                "\nspaceOrChksum='" + spaceOrChksum + '\'' +
                ", last4='" + last4 + '\'' +
                "\n----------------";
    }
}
